<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./layout/newTemplate.xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.org/ui"  
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns="http://www.w3.org/1999/xhtml">
    <ui:define name="content">
        <p:messages id="messag" showDetail="true"  autoUpdate="true" closable="true" > 
            <p:effect type="fade" event="load" delay="#{gestorPrincipal.delayMessage}" />
        </p:messages>

        <h:form id="form">

            <p:dataGrid var="gal" value="#{gestorGalerias.galerias}" columns="2"  
                        rows="12" paginator="true"  
                        paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
                        rowsPerPageTemplate="9,12,15">  

                <p:panel header="#{gal.nombre}" style="text-align:center; width: 300px;height: 350px;"> 
                    <h:panelGrid columns="1" style="width:100%">  
                        
                        <p:graphicImage width="100" height="100" rendered="#{gal.documentos.size() > 0}" value="#{gestorGalerias.preview(gal)}"/>
                        <p:graphicImage width="100" height="100" rendered="#{gal.documentos.size() == 0}" value="#{gestorGalerias.pathGaleria()}gallery-2.png"/>
                        <p:scrollPanel style="width: 100% ;height:100px">
                        <h:outputText value="#{gal.descripcion}" />  
                        </p:scrollPanel>
                        <p:commandButton value="Visualizar" icon="ui-icon-search" action="#{gestorPrincipal.paginaFotosRedir(gal)}"/>  
                    </h:panelGrid>  
                </p:panel>  
            </p:dataGrid>  
        </h:form>
    </ui:define>
</ui:composition>